package com.usst.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.usst.entity.Comment;
import com.usst.repository.CommentRepository;
import com.usst.service.CommentService;

@Service
public class CommentServiceImpl implements CommentService{
	
	@Autowired
	private CommentRepository commentRepo;

	@Override
	public Comment save(Comment comment) {
		return commentRepo.save(comment);
	}

	@Override
	public Comment update(Comment comment){
		return commentRepo.save(comment);
	}

	@Override
	public void delete(Comment comment) {
		commentRepo.delete(comment);
	}

	@Override
	public Comment findOneByUserId(Long userId) {
		return commentRepo.findOneByUserId(userId);
	}

}
